package ejbPart.entity.bankAccount;

import exceptions.AccountException;

import javax.ejb.CreateException;
import javax.ejb.EJBHome;
import javax.ejb.FinderException;
import java.rmi.RemoteException;
import java.util.Collection;

public interface AccountHome extends EJBHome {

    public Account create(String accountId, String ownerName) throws CreateException, RemoteException;

    /**
     * Finds account by it primary key.
     */
    public Account findByPrimaryKey(AccountPK key) throws FinderException, RemoteException;

    public Collection findByOwnerName(String name) throws FinderException, RemoteException;

    /**
     * Calculates the total bank balance.
     */
    public double getTotalBankValue() throws AccountException, RemoteException;

}
